//
//  UITextView+MaxWord.h
//  s.
//
//  Created by fanshijian on 2022/9/1.
//  Copyright © 2022 J. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN


@protocol JYTextViewObjectDelegate <NSObject>

@optional
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;
- (void)textViewDidChange:(UITextView *)textView;

@end

@interface JYTextViewObject : NSObject

@property (weak, nonatomic) id <JYTextViewObjectDelegate> delegate;

@end



typedef void (^ JYChangeTextBlock) (UITextView *textView);

@interface UITextView (MaxWord)

@property (nonatomic, assign) NSInteger wordMax;
@property (nonatomic, assign) BOOL isBytes;
@property (strong, nonatomic) NSString *toastMsg;

@property (copy, nonatomic) JYChangeTextBlock changeBlock;
@property (strong, nonatomic) JYTextViewObject *obj;

@end

NS_ASSUME_NONNULL_END
